/*********************************************************************
	\file :           os_sw_layers\bios\gpt\Gpt_Cfg.h
	\brief:           Contains configuration settings and structures for GPT driver.
	\author:          Manuel Sandoval
	\version:         1.0
	\date:            Sat, 01, March 2014
*********************************************************************/

#ifndef Gpt_Cfg_H
#define Gpt_Cfg_H

/******************************* Includes**********************************/
/* Platform Includes */
#include "p1OsTickTestCases.h"
#include "SchM.h"
#include "typedef_OS.h"

/******************************* Typedef **********************************/

typedef u8 Gpt_ChannelType;			/*!< Numeric ID of a GPT Channel. */

typedef u8 Gpt_ValueType;			/*!<Used for reading the current timer
										value/setting periodic timer values
										(In number of ticks). */

/******************************* Defines **********************************/


/******************************* Enumerations******************************/


/******************************* Structures *******************************/

/** PIT Device configuration.  */
typedef struct PIT_ChannelConfigType
{

    u32 TimeInMicroseconds;			    	/*!< Time in microseconds. */
    u8 TimerSource;		 				 	/*!< Microtimer source */
    tCallbackFn CallbackFunction;		    /*!< Callback function. */
} PIT_ChannelConfigType;


/** PIT Device configuration type.  */
typedef struct PIT_DeviceConfigType
{
    u8 u8NumberOfPITChannels;						/*!< Number of PIT Channels. */
    u8 u8MicroSourceTimer0;		 					/*!< Micro timer source configuration 1. */
    u8 u8MicroSourceTimer1;		 					/*!< Micro timer source configuration 2. */
    PIT_ChannelConfigType *psChannelConfig;			/*!< Pointer to PIT Channel Configuration. */
} PIT_DeviceConfigType;



typedef struct Gpt_DeviceConfigType
{
    PIT_DeviceConfigType *psDeviceConfig;			/*!< Pointer to PIT device configuration structure. */
} Gpt_DeviceConfigType;


/**  GPT driver configuration type. */
typedef struct Gpt_ConfigType
{
    u8 u8NumberOfGptDevices;						/*!< No of Gpt devices. */
    Gpt_DeviceConfigType *psGptDeviceConfig;		/*!< Pointer to device structure. */
} Gpt_ConfigType;

/******************************* Global Variables **********************************/

extern Gpt_ConfigType Mcal_Gpt_Config[];					/*!< Gpt configuration. */

extern Gpt_DeviceConfigType Mcal_Gpt_DeviceConfig[];		/*!< Gpt devices configuration. */

extern PIT_ChannelConfigType Mcal_Pit_ChannelConfig[];		/*!< Pit channel configuration. */

extern PIT_DeviceConfigType Mcal_Pit_DeviceConfig[];		/*!< Pit device configuration. */

/******************************* Functions ********************************/




/** @} *//* End of GPT configuration Group */

#endif /* Gpt_Cfg_H */


/*********************************************************************
	File	: os_sw_layers\bios\gpt\Gpt_Cfg.h 
*********************************************************************/
